SX (Set Exceptions) 

Syntax

SX [[exception]]
SXE exception [[message]] [[/Ccmdlist1]] [[/C2cmdlist2]]
SXD | N}
exception [[message]] [[/C2cmdlist2]]

Parameters

exception

The exception number that the command acts upon, in the current radix. If you do not specify an exception, the SX command will display information on all exceptions.

message

Message to display in the Command window when the exception is trapped.

cmdlist1

Semicolon-separated list of WinDbg commands to execute when an exception first occurs. The /C option is permitted only with the SXE command. Enclose in quotes if cmdlist1 includes spaces or semicolons.

cmdlist2

Semicolon-separated list of WinDbg commands to execute after an exception has not been handled. Enclose in quotes if cmdlist2 includes spaces or semicolons.

 

Description

Controls the behavior of the debugger when trapping exceptions before executing exception-handling code. The debugger always halts before execution returns from the exception handler.

Command

Action

 

SX

Displays the events that the debugger will halt for.

 

SXD

Causes the debugger to ignore the specified exception and issue an automatic GN command.

 

SXE

Causes the debugger to halt at the specified exception.

 

SXN

Causes the debugger to display a message before the exception is passed to the debuggee, and causes the debugger to issue a GN command after the message is displayed.

 

 

The /C option (allowed only with SXE) tells WinDbg to execute the specified debugger commands on the first chance (before the exception is passed to the debuggee). The /C2 option tells WinDbg to execute the specified debugger commands on the second chance (if the exception is not handled by WinDbg or the application). See your documentation on structured exception handling for more information.

When the debugger stops due to an exception, only the GN1MY7V9A (Go Exception Not Handled) and GH1340M_4 (Go Exception Handled) commands can be used to continue execution. The SXD and SXN commands automatically call GN.